﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using NHibernate;
using FluentNHibernate.Data;

namespace BankCreditPortfolio.DAL.Entities
{
    public class Deposit
    {
        public virtual int DepositId { get; set; }
        public virtual DepositType DepositType { get; set; }
        public virtual decimal Amount { get; set; }
        public virtual Currency Currency { get; set; }
        public virtual Account Account { get; set; }
    }

    public class DepositMap : ClassMap<Deposit>
    {
        public DepositMap()
        {
            Id(x => x.DepositId).GeneratedBy.HiLo("deposit");
            Id(x => x.DepositId).Unique();
            Map(x => x.Amount);
            References(x => x.DepositType).Column("DepositTypeId");
            References(x => x.Currency).Column("CurrencyId");
            References(x => x.Account).Column("AccountId");
            Table("Deposit");
        }
    }
}
